//! # Keyboard - 键盘驱动
//!
//! ```
//! let driver = KeyboardDriver::default();
//! ```

use self::key_code::KeyCode;

pub mod key_code;

#[cfg(target_os = "windows")]
pub mod win;

/// 键盘驱动
#[allow(dead_code)]
#[derive(Debug, Default)]
pub struct KeyboardDriver;

#[allow(dead_code)]
impl KeyboardDriver {
    /// 创建键盘驱动
    pub fn new() -> Self {
        KeyboardDriver::default()
    }
}

/// 键盘驱动的功能函数
pub trait KeyboardDriverFunctions {
    /// 按下按键
    ///
    /// # 参数
    ///
    /// * `key_code` - 键码
    ///
    /// # 示例
    ///
    /// ```
    /// KeyboardDriver::key_down(KeyCode::KeyA);
    /// ```
    fn key_down(&self, key_code: KeyCode);

    /// 释放按键
    ///
    /// # 参数
    ///
    /// * `key_code` - 键码
    ///
    /// # 示例
    ///
    /// ```
    /// KeyboardDriver::key_up(KeyCode::KeyA);
    /// ```
    fn key_up(&self, key_code: KeyCode);
}
